﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace SystemContainer.Models
{
    public class ScenicLocation:Location
    {

        [Key, Column(Order = 0)]
        public int ScenicLocationID { get; set; }
        [Key, Column(Order = 1)]
        public int CityID { get; set; }
        public int AOICityID { get; set; }
        public int AreaOfInterestID { get; set; }
        public virtual ICollection<Photo> photos { get; set; }
        public string picUrl { get; set; }
        public virtual AreaOfInterest AOI { get; set; }

        public int AlgorithmID { get; set; }
        [ForeignKey("AlgorithmID")]
        public virtual Algorithm Algorithm { get; set; }

        public void addPicUrl()
        { 
            if(this.CityID == 1)
                this.picUrl = Constants.NYphotoPath + this.photos.FirstOrDefault().Name;
            else if (this.CityID == 2)
                this.picUrl = Constants.LAphotoPath + this.photos.FirstOrDefault().Name;

        }
    }
}
